package com.rd.student.jike.class2.lihongming.week731_806.Day0801;

/**
 * @Auther:Heinrich
 * @Date:2023/8/1-08-01-11:55
 * @Description:com.rd.student.jike.class2.lihongming.Day0801
 * @version:1.0
 */
public class ArrayTest01 {
    public static void main(String[] args) {
        int[] array = new int[10];
        int sum = 0, max = Integer.MIN_VALUE, min = Integer.MAX_VALUE;
        double avarge;
        for (int i = 0; i < array.length; i++) {
            array[i] = i + 1;
            sum += array[i];
        }

        for (int i = 0; i < array.length; i++) {
            max = max < array[i] ? array[i] : max;
            min = min > array[i] ? array[i] : min;

        }
        avarge = (double) (sum) / array.length;
        System.out.println("总和"+sum + ", 最大" + max + ", 最小" + min + ", 平均" + avarge);
    }
}

